package mercurius.fitness.client.rb.exercise.forms;

import java.util.Date;

import com.google.gwt.user.client.rpc.AsyncCallback;

import mercurius.fitness.client.locale.Locale;
import mercurius.fitness.client.rb.exercise.Exercise;
import mercurius.fitness.client.rb.exercise.ExerciseRB;
import net.pleso.framework.client.bl.forms.IAddForm;
import net.pleso.framework.client.bl.forms.items.IFormItemsGroup;
import net.pleso.framework.client.dal.IDataRow;

public class AddExerciseForm extends ExerciseForm implements IAddForm {

	public AddExerciseForm() {
		
	}
	
	public IDataRow createEmptyRow() {
		Exercise e = new Exercise();
		e.setDate(new Date());
		e.setDistanceUnit("1");
		e.setSpeedUnit("1");
		e.setDuration("1:00:00");
		e.setActivity("Mixed;");
		e.setPublic(new Integer("1"));
		return e;
	}

	public void addRow(IDataRow row, AsyncCallback callback) {
		ExerciseRB.getDataSet().add((Exercise) row, callback);
	}

	public String getCaption() {
		return Locale.constants().add_exercise_caption();
	}

	public IFormItemsGroup[] getGroups() {
		return groups;
	}
}
